<?php
namespace Admin\Controller;
use Think\Controller;
class CommonController extends Controller {
	/**
	 * 构造函数
	 */
	public function  _initialize() {
		if(session('?lampzuo_id')){
			$userid = session('lampzuo_id');
			$this->assign("admin_list",M('admin')->where(['id'=>$userid])->field('token,prevlogintime',true)->find());
		}else{
			if($_POST){
				echo json_encode(['LoginStatus'=>'logout','message'=>'未登录！']);die;
			}else{
				header("Location: ".C('WEBURL')."Admin/login");
				die;
			}
		}
	}
}
